﻿@using MvcRags.Core
@using MvcRags.Examples.Models
@using MvcRags.Pagination
@model IEnumerable<MvcRags.Examples.Models.Customer>

<div class="span8">
    <div class="pagination">
        @Html.PageSelectPanel()
    </div>
</div>

<div class="span4">
    <div style="margin: 20px 0">
        <div class="btn-toolbar pull-right" style="margin: 0">
            <div class="btn-group">
                <button class="btn dropdown-toggle" data-toggle="dropdown">
                    @ViewBag.PageEntries
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li>@Html.PageSizeSetLink("10", 10)</li>
                    <li>@Html.PageSizeSetLink("15", 15)</li>
                    <li>@Html.PageSizeSetLink("25", 25)</li>
                    <li>@Html.PageSizeSetLink("50", 50)</li>
                    <li>@Html.PageSizeSetLink("100", 100)</li>
                </ul>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
</div>

<table class="table table-bordered">
    <thead>
        <tr>
            <th>@Html.DisplayNameFor(model => model.Id)</th>
            <th>@Html.DisplayNameFor(model => model.Name)</th>
            <th>@Html.DisplayNameFor(model => model.Country)</th>
            <th>@Html.DisplayNameFor(model => model.Mail)</th>
            <th>@Html.DisplayNameFor(model => model.Pvn)</th>
            <th>@Html.DisplayNameFor(model => model.CreatedAt)</th>
        </tr>
    </thead>
    <tbody>
        @foreach (Customer item in Model)
        {
            <tr>
                <td>@item.Id</td>
                <td>@item.Name</td>
                <td>@item.Country</td>
                <td>@item.Mail</td>
                <td>@item.Pvn</td>
                <td>@item.CreatedAt</td>
            </tr>
        }
    </tbody>
</table>

<div class="span12">
    <div class="pagination" style="text-align: center">
        <span><b>@ViewData[PaginationSettings.ViewDataKeyPageEntries]</b> Customers out of <b>@ViewData[PaginationSettings.ViewDataKeyTotalEntriesCount]</b></span> |
        <span>Page <b>@ViewData[PaginationSettings.ViewDataKeyPage]</b> of <b>@ViewData[PaginationSettings.ViewDataKeyPageCount]</b></span>
    </div>
</div>